1. Field of the Invention
The present invention relates to a method and apparatus for encoding and decoding digital image data and, more specifically, to the encoding and decoding of digital image data comprising consecutive blocks of data groups which are situated at consecutive positions within the blocks and which have as content binary values always of the same number of pixels of an image.
2. Discussion of Related Art
Encoding of image data is of use in systems for digitizing images, such as documents, by linewise scanning with a light-sensitive sensor, processing, storing in a memory and/or transmission of the scanning signals, and printing thereof, for example on paper. To digitize an image with sufficient quality it is necessary to extract and further process a very large number of data thereof and it is therefore desirable to be able to compress such data, particularly for storage and transmission. A first form of compression comprises changing from the multi-value scanning data (grey values) to binary signals (white or black), so that each signal can be represented by just one bit, but even then there is much image data left over. Taking the resolution of 300 dots per inch, which is frequently used in the art, each square centimeter of the image contains approximately 14000 image elements, known as pixels, so that almost one million bits are required for an A4 document.
A method as described herein is disclosed in Applicants' Netherlands patent application No. 9100225. In the known method, run length encoding is applied to a series of consecutive data groups in which each data group has the same content as the data group in the same position in the reference block. Consequently, the code contains the number of data groups in the series. Frequently, however, such series contain a very large number of data groups, such as, for example, in completely white areas at the top and bottom of a document. However, consecutive image lines may contain locally identical information even in parts of an original image which do contain image information, for example if the original image contains parallel lines perpendicular to the scanning direction. In such cases the run length code contains a long number and consequently the code is longer. Apart from the obvious objection of more space taken up by the code, another objection is the fact that the length of the codeword becomes variable as a result and this makes decoding more tedious. Although there are methods of obviating this disadvantage, they in turn make the codewords longer and thus reduce the possible compression factor.